/*
========================================================================
 Name        : SPDContainer.h
 Author      : 
 Copyright   : Your copyright notice
 Description : 
========================================================================
*/
#ifndef SPDCONTAINER_H
#define SPDCONTAINER_H

// [[[ begin generated region: do not modify [Generated Includes]
#include <coecntrl.h>		
#include <aknbutton.h>
#include <stringloader.h>
#include <coecobs.h>
// ]]] end generated region [Generated Includes]


// [[[ begin [Event Handler Includes]
// ]]] end [Event Handler Includes]

// [[[ begin generated region: do not modify [Generated Forward Declarations]
class MEikCommandObserver;		
class CEikImage;
class CAknButton;
class CEikLabel;
// ]]] end generated region [Generated Forward Declarations]

/**
 * Container class for SPDContainer
 * 
 * @class	CSPDContainer SPDContainer.h
 */
class CSPDContainer : public CCoeControl
	,MCoeControlObserver	{
public:
	// constructors and destructor
	CSPDContainer();
	static CSPDContainer* NewL( 
		const TRect& aRect, 
		const CCoeControl* aParent, 
		MEikCommandObserver* aCommandObserver );
	static CSPDContainer* NewLC( 
		const TRect& aRect, 
		const CCoeControl* aParent, 
		MEikCommandObserver* aCommandObserver );
	void ConstructL( 
		const TRect& aRect, 
		const CCoeControl* aParent, 
		MEikCommandObserver* aCommandObserver );
	virtual ~CSPDContainer();

public:
	// from base class CCoeControl
	TInt CountComponentControls() const;
	CCoeControl* ComponentControl( TInt aIndex ) const;
	TKeyResponse OfferKeyEventL( 
			const TKeyEvent& aKeyEvent, 
			TEventCode aType );
	void HandleResourceChange( TInt aType );
	
protected:
	// from base class CCoeControl
	void SizeChanged();

private:
	// from base class CCoeControl
	void Draw( const TRect& aRect ) const;

private:
	void InitializeControlsL();
	void LayoutControls();
	CCoeControl* iFocusControl;
	MEikCommandObserver* iCommandObserver;
	// [[[ begin generated region: do not modify [Generated Methods]
public: 
	// ]]] end generated region [Generated Methods]
	
	// [[[ begin generated region: do not modify [Generated Type Declarations]
public: 
	// ]]] end generated region [Generated Type Declarations]
	
	// [[[ begin generated region: do not modify [Generated Instance Variables]
private: 
	CEikImage* iLogo;
	CAknButton* iWeatherButton;
	CEikImage* iWeather;
	CEikLabel* iCity;
	CEikLabel* iTemperature;
	CEikLabel* iDate;
	CEikLabel* iWeatherDesc;
	CAknButton* iNoticeButton;
	CEikImage* iNoticeIcon;
	CEikLabel* iNoticeText;
	CEikImage* iHomeseparator1;
	CAknButton* iLifeServiceButton;
	CEikImage* iLifeServiceImage;
	CEikLabel* iLifeServiceText;
	CAknButton* iDiscountInfoButton;
	CEikImage* iDiscountInfoImage;
	CEikLabel* iDiscountInfoText;
	CAknButton* iProviderSearchButton;
	CEikImage* iProviderSearchImage;
	CEikLabel* iProviderSearchText;
	CAknButton* iSiteSearchButton;
	CEikImage* iSiteSearchImage;
	CEikLabel* iSiteSearchText;
	CAknButton* iProductInfoButton;
	CEikImage* iProductInfoImage;
	CEikLabel* iProductInfoText;
	CAknButton* iFunGameButton;
	CEikImage* iFunGameImage;
	CEikLabel* iFunGameText;
	CAknButton* iContactUsButton;
	CEikImage* iContactUsImage;
	CEikLabel* iContactUsText;
	CAknButton* iSystemSettingButton;
	CEikImage* iSystemSettingImage;
	CEikLabel* iSystemSettingText;
	CEikImage* iLineSeparator2;
	CEikImage* iBottomImage;
	// ]]] end generated region [Generated Instance Variables]
	
	
	// [[[ begin [Overridden Methods]
protected: 
	void FocusChanged( TDrawNow aDrawNow );
	void HandleControlEventL( 
			CCoeControl* aControl, 
			TCoeEvent anEventType );
	void HandlePointerEventL( const TPointerEvent& aPointerEvent );
	// ]]] end [Overridden Methods]
	
	
	// [[[ begin [User Handlers]
protected: 
	void HandleSPDContainerFocusChanged( TDrawNow aDrawNow );
	void HandleLifeServiceButtonStateChangedL( 
			CCoeControl* aControl, 
			TCoeEvent anEvent );
	void HandleLifeServiceImageStateChangedL( 
			CCoeControl* aControl, 
			TCoeEvent anEvent );
	TKeyResponse HandleSPDContainerOfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
	void HandleSPDContainerPointerEventL( const TPointerEvent& aPointerEvent );
	// ]]] end [User Handlers]
	
public: 
	enum TControls
		{
		// [[[ begin generated region: do not modify [Generated Contents]
		ELogo,
		EWeatherButton,
		EWeather,
		ECity,
		ETemperature,
		EDate,
		EWeatherDesc,
		ENoticeButton,
		ENoticeIcon,
		ENoticeText,
		EHomeseparator1,
		ELifeServiceButton,
		ELifeServiceImage,
		ELifeServiceText,
		EDiscountInfoButton,
		EDiscountInfoImage,
		EDiscountInfoText,
		EProviderSearchButton,
		EProviderSearchImage,
		EProviderSearchText,
		ESiteSearchButton,
		ESiteSearchImage,
		ESiteSearchText,
		EProductInfoButton,
		EProductInfoImage,
		EProductInfoText,
		EFunGameButton,
		EFunGameImage,
		EFunGameText,
		EContactUsButton,
		EContactUsImage,
		EContactUsText,
		ESystemSettingButton,
		ESystemSettingImage,
		ESystemSettingText,
		ELineSeparator2,
		EBottomImage,
		
		// ]]] end generated region [Generated Contents]
		
		// add any user-defined entries here...
		
		ELastControl
		};
	
	// [[[ begin [MCoeControlObserver support]
private: 
	typedef void ( CSPDContainer::*ControlEventHandler )( 
			CCoeControl* aControl, TCoeEvent anEvent );
	
	void AddControlEventHandlerL( 
			CCoeControl* aControl, 
			TCoeEvent anEvent, 
			ControlEventHandler aHandler );
	
	class TControlEventDispatch 
		{
	public: 
		CCoeControl* src; 
		TCoeEvent event; 
		ControlEventHandler handler;
		};
		
	RArray< TControlEventDispatch > iControlEventDispatch;
	// ]]] end [MCoeControlObserver support]
	
	};
				
#endif // SPDCONTAINER_H
